<?php
const DEBUG_PASS = 'zmkm';
if (!isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_PW'] != DEBUG_PASS) {
    header('WWW-Authenticate:Basic realm="Debug"');
    die ("Not auth.");
} else {
    echo "<p>Hello {$_SERVER["PHP_AUTH_USER"]}.</p>";
    echo "<p>You entered {$_SERVER["PHP_AUTH_PW"]} as your password.</p>";
    echo $_SERVER['HTTP_AUTHORIZATION'];
    $header = getallheaders();
    list($user, $pw) = explode(':', base64_decode(substr($header['Authorization'], 6)));
    var_dump($user, $pw);
}